using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Collections.Specialized;

/// <summary>
/// Summary description for DataManager
/// </summary>
namespace DD.Data.SQL
{
    public static class DataManager
    {
        public static SqlConnection GetConnection()
        {
            NameValueCollection Config = System.Web.Configuration.WebConfigurationManager.AppSettings;
            
            string ConnectionString = Config["ConnectionString"];
            SqlConnection conn = new SqlConnection(ConnectionString);
            return conn;
        }
        public static DataSet FillDataSet(string QueryString)
        {
            SqlDataAdapter da = new SqlDataAdapter();
            SqlCommand comm = new SqlCommand();
            DataSet ReturnDS = new DataSet();
            comm.Connection = GetConnection();
            comm.CommandText = QueryString;
            da.SelectCommand = comm;
            da.Fill(ReturnDS);

            return ReturnDS;
            
        }
    } 
}
